forked from jwgrenning/tddec-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lenghtened the loop count for RandomMinute and gcc7
- Loading branch information
1 parent
8f5d449
commit 0d239ef
Showing
4 changed files
with
63 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
//- ------------------------------------------------------------------ | ||
//- Copyright (c) James W. Grenning -- All Rights Reserved | ||
//- For use by owners of Test-Driven Development for Embedded C, | ||
//- and attendees of Renaissance Software Consulting, Co. training | ||
//- classes. | ||
//- | ||
//- Available at http://pragprog.com/titles/jgade/ | ||
//- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 | ||
//- | ||
//- Authorized users may use this source code in your own | ||
//- projects, however the source code may not be used to | ||
//- create training material, courses, books, articles, and | ||
//- the like. We make no guarantees that this source code is | ||
//- fit for any purpose. | ||
//- | ||
//- www.renaissancesoftware.net [email protected] | ||
//- ------------------------------------------------------------------ | ||
|
||
|
||
//- ------------------------------------------------------------------ | ||
//- Copyright (c) James W. Grenning -- All Rights Reserved | ||
//- For use by owners of Test-Driven Development for Embedded C, | ||
//- and attendees of Renaissance Software Consulting, Co. training | ||
//- classes. | ||
//- | ||
//- Available at http://pragprog.com/titles/jgade/ | ||
//- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 | ||
//- | ||
//- Authorized users may use this source code in your own | ||
//- projects, however the source code may not be used to | ||
//- create training material, courses, books, articles, and | ||
//- the like. We make no guarantees that this source code is | ||
//- fit for any purpose. | ||
//- | ||
//- www.renaissancesoftware.net [email protected] | ||
//- ------------------------------------------------------------------ | ||
|
||
|
||
#include "CppUTest/TestHarness.h" | ||
|
||
extern "C" | ||
|
@@ -33,7 +33,7 @@ TEST_GROUP(RandomMinute) | |
|
||
void setup() | ||
{ | ||
RandomMinute_Create(BOUND); | ||
RandomMinute_Create(BOUND); | ||
srand(1); | ||
} | ||
|
||
|
@@ -64,7 +64,7 @@ TEST(RandomMinute, AllValuesPossible) | |
int hit[2*BOUND + 1]; | ||
memset(hit, 0, sizeof(hit)); | ||
|
||
for (int i = 0; i < 300; i++) | ||
for (int i = 0; i < 350; i++) | ||
{ | ||
minute = RandomMinute_Get(); | ||
if (minute < -BOUND || minute > BOUND) | ||
|
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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
//- ------------------------------------------------------------------ | ||
//- Copyright (c) James W. Grenning -- All Rights Reserved | ||
//- For use by owners of Test-Driven Development for Embedded C, | ||
//- and attendees of Renaissance Software Consulting, Co. training | ||
//- classes. | ||
//- | ||
//- Available at http://pragprog.com/titles/jgade/ | ||
//- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 | ||
//- | ||
//- Authorized users may use this source code in your own | ||
//- projects, however the source code may not be used to | ||
//- create training material, courses, books, articles, and | ||
//- the like. We make no guarantees that this source code is | ||
//- fit for any purpose. | ||
//- | ||
//- www.renaissancesoftware.net [email protected] | ||
//- ------------------------------------------------------------------ | ||
|
||
//- ------------------------------------------------------------------ | ||
//- Copyright (c) James W. Grenning -- All Rights Reserved | ||
//- For use by owners of Test-Driven Development for Embedded C, | ||
//- and attendees of Renaissance Software Consulting, Co. training | ||
//- classes. | ||
//- | ||
//- Available at http://pragprog.com/titles/jgade/ | ||
//- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 | ||
//- | ||
//- Authorized users may use this source code in your own | ||
//- projects, however the source code may not be used to | ||
//- create training material, courses, books, articles, and | ||
//- the like. We make no guarantees that this source code is | ||
//- fit for any purpose. | ||
//- | ||
//- www.renaissancesoftware.net [email protected] | ||
//- ------------------------------------------------------------------ | ||
|
||
#include "CppUTest/TestHarness.h" | ||
|
||
extern "C" | ||
{ | ||
#include <stdio.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include "RandomMinute.h" | ||
} | ||
|
@@ -32,7 +32,7 @@ TEST_GROUP(RandomMinute) | |
|
||
void setup() | ||
{ | ||
RandomMinute_Create(Bound); | ||
RandomMinute_Create(Bound); | ||
srand(1); | ||
} | ||
|
||
|
@@ -63,7 +63,7 @@ TEST(RandomMinute, AllValuesPossible) | |
int hit[2*Bound + 1]; | ||
memset(hit, 0, sizeof(hit)); | ||
|
||
for (int i = 0; i < 300; i++) | ||
for (int i = 0; i < 350; i++) | ||
{ | ||
minute = RandomMinute_Get(); | ||
if (minute < -Bound || minute > Bound) | ||
|
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
//- ------------------------------------------------------------------ | ||
//- Copyright (c) James W. Grenning -- All Rights Reserved | ||
//- For use by owners of Test-Driven Development for Embedded C, | ||
//- and attendees of Renaissance Software Consulting, Co. training | ||
//- classes. | ||
//- | ||
//- Available at http://pragprog.com/titles/jgade/ | ||
//- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 | ||
//- | ||
//- Authorized users may use this source code in your own | ||
//- projects, however the source code may not be used to | ||
//- create training material, courses, books, articles, and | ||
//- the like. We make no guarantees that this source code is | ||
//- fit for any purpose. | ||
//- | ||
//- www.renaissancesoftware.net [email protected] | ||
//- ------------------------------------------------------------------ | ||
|
||
//- ------------------------------------------------------------------ | ||
//- Copyright (c) James W. Grenning -- All Rights Reserved | ||
//- For use by owners of Test-Driven Development for Embedded C, | ||
//- and attendees of Renaissance Software Consulting, Co. training | ||
//- classes. | ||
//- | ||
//- Available at http://pragprog.com/titles/jgade/ | ||
//- ISBN 1-934356-62-X, ISBN13 978-1-934356-62-3 | ||
//- | ||
//- Authorized users may use this source code in your own | ||
//- projects, however the source code may not be used to | ||
//- create training material, courses, books, articles, and | ||
//- the like. We make no guarantees that this source code is | ||
//- fit for any purpose. | ||
//- | ||
//- www.renaissancesoftware.net [email protected] | ||
//- ------------------------------------------------------------------ | ||
|
||
#include "CppUTest/TestHarness.h" | ||
|
||
extern "C" | ||
|
@@ -32,7 +32,7 @@ TEST_GROUP(RandomMinute) | |
|
||
void setup() | ||
{ | ||
RandomMinute_Create(Bound); | ||
RandomMinute_Create(Bound); | ||
srand(1); | ||
} | ||
|
||
|
@@ -63,7 +63,7 @@ TEST(RandomMinute, AllValuesPossible) | |
int hit[2*Bound + 1]; | ||
memset(hit, 0, sizeof(hit)); | ||
|
||
for (int i = 0; i < 300; i++) | ||
for (int i = 0; i < 350; i++) | ||
{ | ||
minute = RandomMinute_Get(); | ||
if (minute < -Bound || minute > Bound) | ||
|